<div class="col-sm-12 search-collapse">
    <form id="role-form">
        <div class="select-list">
            <ul>
                <li><?= \common\widgets\FormInput::widget(['name'=>'input|登录名称','extend'=>['name'=>'where[login_name]']])?></li>
                <li><?= \common\widgets\FormInput::widget(['name'=>'input|登录地址','extend'=>['name'=>'like[ipaddr]']])?></li>
                <li><?= \common\widgets\FormInput::widget(['name'=>'select|登陆状态','extend'=>['name'=>'where[status]','value'=>'','place'=>'所有','data'=>[1=>'成功',0=>'失败']]])?></li>
                <li>
                    <?= $this->render('/iframe',['name'=>'searchbtn|搜索'])?>
                    <?= $this->render('/iframe',['name'=>'resetbtn|重置'])?>
                </li>
            </ul>
        </div>
    </form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
    <?= $this->render('/iframe',['name'=>'deletebtn'])?>
    <?= $this->render('/iframe',['name'=>'trashbtn'])?>
</div>
<div class="col-sm-12 select-table table-striped">
    <table id="bootstrap-table"></table>
</div>

<?php $this->beginBlock('script'); ?>
<script>
    $(function () {
        var options = {
            modalName: "登录日志",
            sortName:'oper_time',
            sortOrder: "desc",
            detailUrl: decodeURIComponent("<?=\yii\helpers\Url::toRoute(['detail', 'id' => '{id}'])?>"),
            columns: [
                {checkbox: true},
                {field: 'id', title: '日志编号', align: 'center', sortable: true},
                {field: 'oper_url', title: '请求URL'},
                {field: 'request_method', title :'请求方式'},
                {
                    field: 'auid',
                    title: '请求人',
                    formatter: function(value, row, index) {
                        return row.rolename+'<br/>'+row.username;

                    }
                },
                {field: 'os', title: '系统'},
                {field: 'browser', title: '浏览器'},
                {
                    field: 'status',
                    title: '操作状态',
                    formatter: function(value, row, index) {
                        return $.view.statusShow(row,false,['失败','成功']);

                    }
                },
                {field: 'oper_time', title: '操作时间'},
                {
                    title: '操作',
                    formatter: function(value, row, index) {
                        return '<?=$this->render("/iframe",["name"=>"formopbtn","extend"=>["type"=>["detail"],"rowId"=>"row.id"]])?>';
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
<?php $this->endBlock(); ?>

